//
//  CommentCell.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/4/15.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "CommentCell.h"
#import "AddressField.h"

@interface CommentCell()

@property (weak, nonatomic) IBOutlet AddressField *commentField;
@property (weak, nonatomic) IBOutlet UIButton *publicBtn;

@end

@implementation CommentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.publicBtn.layer.borderColor = [UIColor redColor].CGColor;
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        self.commentField.placeHolder = @"请输入您的评价";
    });
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textDidChanged:) name:UITextViewTextDidChangeNotification object:nil];
}

- (void)textDidChanged:(NSNotification *)noti
{
    UITextView *textview = noti.object;
    self.model.commentContent = textview.text;
}
- (IBAction)commentClick:(UIButton *)sender
{
    if (self.commentBlock) {
        self.commentBlock();
    }
}

@end
